#include "mystdio.h"
#include <stdio.h>
int main(){

  //使用自己封装的c接口
  FILE_* fp = fopen_("./log.txt","w");
  if(fp == NULL){
    return 1;
  }
  int cnt =10;
  const char* arr = "hello linux\n";

  while(1){
    fwrite_(arr,strlen(arr),fp);
    fflush_(fp);
    sleep(1);
    printf("count: %d\n",cnt);
   // if(cnt %5 == 0) fflush_(fp);
    cnt--;
    if(cnt == 0) break;
  }
  
  fclose_(fp);
  return 0;
}

